<?php
/**
 * Created by IntelliJ IDEA.
 * User: xmiao
 * Date: 2018/12/11
 * Time: 15:15
 */

namespace app\magic\service\admin;
use \app\magic\dao\AdminDao;

class IndexService
{
    private $adminDao =null;
    /*
     * 登录验证
     */
    public function chkLogin($data){
        $data['password']=md5('bf680763e49fa376cb35edeb06cd6945'.trim($data['password']));
        $this->adminDao = new AdminDao();
        $res=$this->adminDao->find($data);
        if($res){
            session('uid',$res['id']);
            session('uname',$res['username']);
            return true;
        }else{
            return false;
        }
    }
}